package indi.wshape1.takeawaydeliveryinfo.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import indi.wshape1.takeawaydeliveryinfo.mapper.RootMapper;
import indi.wshape1.takeawaydeliveryinfo.pojo.Root;
import indi.wshape1.takeawaydeliveryinfo.service.RootService;
import org.springframework.stereotype.Service;

/**
 * @author Wshape1
 * @description 针对表【root】的数据库操作Service实现
 * @since 2023-01-17 12:57:25
 */
@Service
public class RootServiceImpl extends ServiceImpl<RootMapper, Root>
        implements RootService {

    @Override
    public boolean verify(String phone, String password) {
        QueryWrapper<Root> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("name", phone);
        Root root = getOne(queryWrapper);
        if (root != null) {
            return password.equals(root.getPassword());
        }
        return false;
    }

}




